RO

Ajuda Script Quest De Addon

Por romeu23, 16 de mai. de 2012 em Scripts

ajuda ai valendo rep+
otserv
tibia
script
12
2.2k
romeu23R
16 de maio de 2012 às 15:14

Ola xtibia,

Estou com um script de addon por quest, queria inovar esta quest! queria que a quest só poderia ser feita se ele tivesse 3 items. Ex: quando o player da use no baú e ele nao tiver os 3 items irá apareçer a seguinte mensagem: Voce não tem 'demon helmet', 'demon armor, 'demon legs' então não pode fazer a quest.. e se caso o player tivesse , ele iria ganhar a addon e os items irá sumir!

if item.uid == 8913 then

queststatus = getPlayerStorageValue(cid,1500)

if queststatus == -1 then

doPlayerSendTextMessage(cid,22,"You have found the citizen addon full.")

doPlayerAddOutfit(cid, 128, 3)

doPlayerAddOutfit(cid, 136, 3)

else

doPlayerSendTextMessage(cid,22,"It is empty.")

end

 

VodkartV
16 de maio de 2012 às 15:49

todos os addons ou só determinado addons? por exemplo no seu caso, cintizen

romeu23R
16 de maio de 2012 às 19:38

todos os addons vodkart..

 

desculpa pela demora ! kkk é que não tava em casa .. tava no trampo.! haha

VodkartV
16 de maio de 2012 às 21:39

lib/functions

function getItemsFromList(items) -- by vodka
local str = ''
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1])
if i ~= table.maxn(items) then str = str .. ', ' end end end
return str
end
function doRemoveItemsFromList(cid,items) -- by vodka
local count = 0
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
count = count + 1 end  end  end
if count == table.maxn(items) then
for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
else return false end
return true end

 

script

 

function onUse(cid, item, frompos, item2, topos)
local config = {
storage = 85454,
items = {{2494,1},{2123,1},{8925,1}}, -- defina seus items
outfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 336, 366,136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 335, 367}
}
if getPlayerStorageValue(cid,config.storage) >= 1 then
return doPlayerSendTextMessage(cid,22,"It is empty.")
elseif not doRemoveItemsFromList(cid,config.items) then
return doPlayerSendTextMessage(cid,22,"you need "..getItemsFromList(config.items).." to open this chest.")
end
for i = 1,#config.outfits do
doPlayerAddOutfit(cid, config.outfits[i], 3)
end
doPlayerSendTextMessage(cid,25,'You have found the all addon full.')
doSendMagicEffect(getCreaturePosition(cid),14)
setPlayerStorageValue(cid, config.storage, 1)
return true
end

Editado Maio 16 por Vodkart

romeu23R
17 de maio de 2012 às 17:53

Vodkart, obrigado ! vou testar amanha , pq to morrendo de canssaço ai amanha atarde testo.. teria tbm como vc postar o script de uma outfit só ou é so configurar as outifts la do script ?

 

Vodka não funcionou :s

Editado Maio 16 por Esaus

VodkartV
17 de maio de 2012 às 17:58

o que não funcionou? e qual o erro?

Makelin1M
17 de maio de 2012 às 18:04

então editei ele aki rapidinho

 

local itemid = 2160 --Poem o id do item que vai checkar

local itemid1 = 2160 --Poem o outro id do item que vai checkar

local itemid2 = 2160 --Poem o outro id do item que vai checkar tbm

if item.uid == 8913 then

queststatus = getPlayerStorageValue(cid,1500)

if getPlayerItemCount(cid, config.itemid) >= 1 then

if getPlayerItemCount(cid, config.itemid1) >= 1 then

if getPlayerItemCount(cid, config.itemid2) >= 1 then

if queststatus == -1 then

doPlayerSendTextMessage(cid,22,"You have found the citizen addon full.")

doPlayerAddOutfit(cid, 128, 3)

doPlayerAddOutfit(cid, 136, 3)

else

doPlayerSendTextMessage(cid,22,"It is empty.")

end

return TRUE

end

end

end

 

 

espero ter ajudado

ate

romeu23R
17 de maio de 2012 às 19:55

Smartbox , não teria como botar uma quantidade de item que deveria ter? Ex : tinha que ter 100 minotaur leather, como seria?

 

E se caso o player não tivesse os items.. iria aparçer uma mensagem avisando..

Makelin1M
17 de maio de 2012 às 19:58
local itemid = 2160 --Poem o id do item que vai checkar

local itemid1 = 2160 --Poem o outro id do item que vai checkar

local itemid2 = 2160 --Poem o outro id do item que vai checkar tbm

if item.uid == 8913 then

queststatus = getPlayerStorageValue(cid,1500)

if getPlayerItemCount(cid, config.itemid) >= 1 then

if getPlayerItemCount(cid, config.itemid1) >= 1 then

if getPlayerItemCount(cid, config.itemid2) >= 1 then

if queststatus == -1 then

doPlayerSendTextMessage(cid,22,"You have found the citizen addon full.")

doPlayerAddOutfit(cid, 128, 3)

doPlayerAddOutfit(cid, 136, 3)

else

doPlayerSendTextMessage(cid,22,"Vc ja pegou o item ou nao tem o item que precisa ter para fazer a quest .")

end

return TRUE

end

end

end

 

pronto editei

 

nesta tag

 

if getPlayerItemCount(cid, config.itemid) >= 1 then
onde esta o numero "1" significa a quantidade

espero ter ajudado

ate

romeu23R
17 de maio de 2012 às 20:19

Vlw ! REP +

 

Vodkart acho que ja consiguir o showbox arrumo aq.. vlww ! amanha vou te dar o REP ! o meu acabou hj ! amanha volta ai te o rep!! :p

Makelin1M
17 de maio de 2012 às 20:29

Duvida sanada topico

reportado

VildenV
17 de maio de 2012 às 23:37

Dúvida sanada, movido.

 

rep+ smartbox por esta ajudando com reports